\(\int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx\) [1248]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 174 \[ \int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=5 a b x-\frac {5 \left (3 a^2-4 b^2\right ) \text {arctanh}(\cos (c+d x))}{8 d}+\frac {\left (a^2-2 b^2\right ) \cos (c+d x)}{d}-\frac {b^2 \cos ^3(c+d x)}{3 d}+\frac {5 a b \cot (c+d x)}{d}-\frac {5 a b \cot ^3(c+d x)}{3 d}+\frac {a b \cos ^2(c+d x) \cot ^3(c+d x)}{d}+\frac {\left (9 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d} \]

[Out]

5*a*b*x-5/8*(3*a^2-4*b^2)*arctanh(cos(d*x+c))/d+(a^2-2*b^2)*cos(d*x+c)/d-1/3*b^2*cos(d*x+c)^3/d+5*a*b*cot(d*x+
c)/d-5/3*a*b*cot(d*x+c)^3/d+a*b*cos(d*x+c)^2*cot(d*x+c)^3/d+1/8*(9*a^2-4*b^2)*cot(d*x+c)*csc(d*x+c)/d-1/4*a^2*
cot(d*x+c)*csc(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2990, 2671, 294, 308, 209, 466, 1828, 1167, 212} \[ \int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {5 \left (3 a^2-4 b^2\right ) \text {arctanh}(\cos (c+d x))}{8 d}+\frac {\left (a^2-2 b^2\right ) \cos (c+d x)}{d}+\frac {\left (9 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {5 a b \cot ^3(c+d x)}{3 d}+\frac {5 a b \cot (c+d x)}{d}+\frac {a b \cos ^2(c+d x) \cot ^3(c+d x)}{d}+5 a b x-\frac {b^2 \cos ^3(c+d x)}{3 d} \]

[In]

Int[Cos[c + d*x]*Cot[c + d*x]^5*(a + b*Sin[c + d*x])^2,x]

[Out]

5*a*b*x - (5*(3*a^2 - 4*b^2)*ArcTanh[Cos[c + d*x]])/(8*d) + ((a^2 - 2*b^2)*Cos[c + d*x])/d - (b^2*Cos[c + d*x]
^3)/(3*d) + (5*a*b*Cot[c + d*x])/d - (5*a*b*Cot[c + d*x]^3)/(3*d) + (a*b*Cos[c + d*x]^2*Cot[c + d*x]^3)/d + ((
9*a^2 - 4*b^2)*Cot[c + d*x]*Csc[c + d*x])/(8*d) - (a^2*Cot[c + d*x]*Csc[c + d*x]^3)/(4*d)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 294

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^
n)^(p + 1)/(b*n*(p + 1))), x] - Dist[c^n*((m - n + 1)/(b*n*(p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^(p + 1), x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m + 1, n] &&  !ILtQ[(m + n*(p + 1) + 1)/n, 0]
&& IntBinomialQ[a, b, c, n, m, p, x]

Rule 308

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 466

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-a)^(m/2 - 1)*(b*c - a*d)*x
*((a + b*x^2)^(p + 1)/(2*b^(m/2 + 1)*(p + 1))), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[(a + b*x^2)^(p + 1)*E
xpandToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d))/(a + b*x^2)]
- (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[
m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 1167

Int[((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x^2)^q*(a + b*x^2 + c*x^4)^p, x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 -
b*d*e + a*e^2, 0] && IGtQ[p, 0] && IGtQ[q, -2]

Rule 1828

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x^2, x], f = Coeff[P
olynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 1]}, Simp[(a*
g - b*f*x)*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Dist[1/(2*a*(p + 1)), Int[(a + b*x^2)^(p + 1)*ExpandToS
um[2*a*(p + 1)*Q + f*(2*p + 3), x], x], x]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && LtQ[p, -1]

Rule 2671

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> With[{ff = FreeFactors[Ta
n[e + f*x], x]}, Dist[b*(ff/f), Subst[Int[(ff*x)^(m + n)/(b^2 + ff^2*x^2)^(m/2 + 1), x], x, b*(Tan[e + f*x]/ff
)], x]] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2]

Rule 2990

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^2, x_Symbol] :> Dist[2*a*(b/d), Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^(n + 1), x], x] + Int[(g*Cos[e
+ f*x])^p*(d*Sin[e + f*x])^n*(a^2 + b^2*Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && NeQ[a^2 -
 b^2, 0]

Rubi steps \begin{align*} \text {integral}& = (2 a b) \int \cos ^2(c+d x) \cot ^4(c+d x) \, dx+\int \cos (c+d x) \cot ^5(c+d x) \left (a^2+b^2 \sin ^2(c+d x)\right ) \, dx \\ & = -\frac {\text {Subst}\left (\int \frac {x^6 \left (a^2+b^2-b^2 x^2\right )}{\left (1-x^2\right )^3} \, dx,x,\cos (c+d x)\right )}{d}-\frac {(2 a b) \text {Subst}\left (\int \frac {x^6}{\left (1+x^2\right )^2} \, dx,x,\cot (c+d x)\right )}{d} \\ & = \frac {a b \cos ^2(c+d x) \cot ^3(c+d x)}{d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}+\frac {\text {Subst}\left (\int \frac {a^2+4 a^2 x^2+4 a^2 x^4-4 b^2 x^6}{\left (1-x^2\right )^2} \, dx,x,\cos (c+d x)\right )}{4 d}-\frac {(5 a b) \text {Subst}\left (\int \frac {x^4}{1+x^2} \, dx,x,\cot (c+d x)\right )}{d} \\ & = \frac {a b \cos ^2(c+d x) \cot ^3(c+d x)}{d}+\frac {\left (9 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {\text {Subst}\left (\int \frac {7 a^2-4 b^2+8 \left (a^2-b^2\right ) x^2-8 b^2 x^4}{1-x^2} \, dx,x,\cos (c+d x)\right )}{8 d}-\frac {(5 a b) \text {Subst}\left (\int \left (-1+x^2+\frac {1}{1+x^2}\right ) \, dx,x,\cot (c+d x)\right )}{d} \\ & = \frac {5 a b \cot (c+d x)}{d}-\frac {5 a b \cot ^3(c+d x)}{3 d}+\frac {a b \cos ^2(c+d x) \cot ^3(c+d x)}{d}+\frac {\left (9 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {\text {Subst}\left (\int \left (-8 \left (a^2-2 b^2\right )+8 b^2 x^2+\frac {5 \left (3 a^2-4 b^2\right )}{1-x^2}\right ) \, dx,x,\cos (c+d x)\right )}{8 d}-\frac {(5 a b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (c+d x)\right )}{d} \\ & = 5 a b x+\frac {\left (a^2-2 b^2\right ) \cos (c+d x)}{d}-\frac {b^2 \cos ^3(c+d x)}{3 d}+\frac {5 a b \cot (c+d x)}{d}-\frac {5 a b \cot ^3(c+d x)}{3 d}+\frac {a b \cos ^2(c+d x) \cot ^3(c+d x)}{d}+\frac {\left (9 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {\left (5 \left (3 a^2-4 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{8 d} \\ & = 5 a b x-\frac {5 \left (3 a^2-4 b^2\right ) \text {arctanh}(\cos (c+d x))}{8 d}+\frac {\left (a^2-2 b^2\right ) \cos (c+d x)}{d}-\frac {b^2 \cos ^3(c+d x)}{3 d}+\frac {5 a b \cot (c+d x)}{d}-\frac {5 a b \cot ^3(c+d x)}{3 d}+\frac {a b \cos ^2(c+d x) \cot ^3(c+d x)}{d}+\frac {\left (9 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 6.56 (sec) , antiderivative size = 337, normalized size of antiderivative = 1.94 \[ \int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {5 a b (c+d x)}{d}+\frac {(2 a-3 b) (2 a+3 b) \cos (c+d x)}{4 d}-\frac {b^2 \cos (3 (c+d x))}{12 d}+\frac {7 a b \cot \left (\frac {1}{2} (c+d x)\right )}{3 d}+\frac {\left (9 a^2-4 b^2\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {a b \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{12 d}-\frac {a^2 \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {5 \left (3 a^2-4 b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {5 \left (3 a^2-4 b^2\right ) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {\left (-9 a^2+4 b^2\right ) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {a^2 \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {a b \sin (2 (c+d x))}{2 d}-\frac {7 a b \tan \left (\frac {1}{2} (c+d x)\right )}{3 d}+\frac {a b \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{12 d} \]

[In]

Integrate[Cos[c + d*x]*Cot[c + d*x]^5*(a + b*Sin[c + d*x])^2,x]

[Out]

(5*a*b*(c + d*x))/d + ((2*a - 3*b)*(2*a + 3*b)*Cos[c + d*x])/(4*d) - (b^2*Cos[3*(c + d*x)])/(12*d) + (7*a*b*Co
t[(c + d*x)/2])/(3*d) + ((9*a^2 - 4*b^2)*Csc[(c + d*x)/2]^2)/(32*d) - (a*b*Cot[(c + d*x)/2]*Csc[(c + d*x)/2]^2
)/(12*d) - (a^2*Csc[(c + d*x)/2]^4)/(64*d) - (5*(3*a^2 - 4*b^2)*Log[Cos[(c + d*x)/2]])/(8*d) + (5*(3*a^2 - 4*b
^2)*Log[Sin[(c + d*x)/2]])/(8*d) + ((-9*a^2 + 4*b^2)*Sec[(c + d*x)/2]^2)/(32*d) + (a^2*Sec[(c + d*x)/2]^4)/(64
*d) + (a*b*Sin[2*(c + d*x)])/(2*d) - (7*a*b*Tan[(c + d*x)/2])/(3*d) + (a*b*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2]
)/(12*d)

Maple [A] (verified)

Time = 0.69 (sec) , antiderivative size = 237, normalized size of antiderivative = 1.36

method result size
parallelrisch \(\frac {\left (46080 a^{2}-61440 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+96 a^{2} \left (\sec ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\csc ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\frac {327}{32}+\cos \left (5 d x +5 c \right )+\frac {109 \cos \left (4 d x +4 c \right )}{32}-\frac {15 \cos \left (3 d x +3 c \right )}{2}-\frac {109 \cos \left (2 d x +2 c \right )}{8}+\frac {5 \cos \left (d x +c \right )}{2}\right )+192 b \left (\sec ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\cos \left (5 d x +5 c \right )+10 \cos \left (d x +c \right )-\frac {65 \cos \left (3 d x +3 c \right )}{3}\right ) a \left (\csc ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+128 b^{2} \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\csc ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (-65+\cos \left (5 d x +5 c \right )+25 \cos \left (3 d x +3 c \right )+65 \cos \left (2 d x +2 c \right )-50 \cos \left (d x +c \right )\right )+122880 a b x d}{24576 d}\) \(237\)
derivativedivides \(\frac {a^{2} \left (-\frac {\cos ^{7}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {3 \left (\cos ^{7}\left (d x +c \right )\right )}{8 \sin \left (d x +c \right )^{2}}+\frac {3 \left (\cos ^{5}\left (d x +c \right )\right )}{8}+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {15 \cos \left (d x +c \right )}{8}+\frac {15 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )+2 a b \left (-\frac {\cos ^{7}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {4 \left (\cos ^{7}\left (d x +c \right )\right )}{3 \sin \left (d x +c \right )}+\frac {4 \left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )+b^{2} \left (-\frac {\cos ^{7}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{5}\left (d x +c \right )\right )}{2}-\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{6}-\frac {5 \cos \left (d x +c \right )}{2}-\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )}{d}\) \(245\)
default \(\frac {a^{2} \left (-\frac {\cos ^{7}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {3 \left (\cos ^{7}\left (d x +c \right )\right )}{8 \sin \left (d x +c \right )^{2}}+\frac {3 \left (\cos ^{5}\left (d x +c \right )\right )}{8}+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {15 \cos \left (d x +c \right )}{8}+\frac {15 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )+2 a b \left (-\frac {\cos ^{7}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {4 \left (\cos ^{7}\left (d x +c \right )\right )}{3 \sin \left (d x +c \right )}+\frac {4 \left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )+b^{2} \left (-\frac {\cos ^{7}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{5}\left (d x +c \right )\right )}{2}-\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{6}-\frac {5 \cos \left (d x +c \right )}{2}-\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )}{d}\) \(245\)
norman \(\frac {-\frac {a^{2}}{64 d}+\frac {a^{2} \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {\left (13 a^{2}-8 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}-\frac {\left (13 a^{2}-8 b^{2}\right ) \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {\left (29 a^{2}-55 b^{2}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {\left (211 a^{2}-300 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}+\frac {\left (327 a^{2}-520 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{12 d}+\frac {2 a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {25 a b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {25 a b \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {2 a b \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {a b \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+5 a b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+15 a b x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+15 a b x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+5 a b x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}+\frac {5 \left (3 a^{2}-4 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}\) \(388\)
risch \(5 a b x -\frac {{\mathrm e}^{3 i \left (d x +c \right )} b^{2}}{24 d}-\frac {i a b \,{\mathrm e}^{2 i \left (d x +c \right )}}{4 d}+\frac {a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {9 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {9 \,{\mathrm e}^{-i \left (d x +c \right )} b^{2}}{8 d}+\frac {i a b \,{\mathrm e}^{-2 i \left (d x +c \right )}}{4 d}-\frac {{\mathrm e}^{-3 i \left (d x +c \right )} b^{2}}{24 d}-\frac {-144 i a b \,{\mathrm e}^{6 i \left (d x +c \right )}+27 a^{2} {\mathrm e}^{7 i \left (d x +c \right )}-12 b^{2} {\mathrm e}^{7 i \left (d x +c \right )}+336 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-3 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}+12 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-304 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-3 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+12 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+112 i a b +27 a^{2} {\mathrm e}^{i \left (d x +c \right )}-12 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}-\frac {15 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}+\frac {5 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2}}{2 d}+\frac {15 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}-\frac {5 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2}}{2 d}\) \(401\)

[In]

int(cos(d*x+c)^6*csc(d*x+c)^5*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/24576*((46080*a^2-61440*b^2)*ln(tan(1/2*d*x+1/2*c))+96*a^2*sec(1/2*d*x+1/2*c)^4*csc(1/2*d*x+1/2*c)^4*(327/32
+cos(5*d*x+5*c)+109/32*cos(4*d*x+4*c)-15/2*cos(3*d*x+3*c)-109/8*cos(2*d*x+2*c)+5/2*cos(d*x+c))+192*b*sec(1/2*d
*x+1/2*c)^3*(cos(5*d*x+5*c)+10*cos(d*x+c)-65/3*cos(3*d*x+3*c))*a*csc(1/2*d*x+1/2*c)^3+128*b^2*sec(1/2*d*x+1/2*
c)^2*csc(1/2*d*x+1/2*c)^2*(-65+cos(5*d*x+5*c)+25*cos(3*d*x+3*c)+65*cos(2*d*x+2*c)-50*cos(d*x+c))+122880*a*b*x*
d)/d

Fricas [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 309, normalized size of antiderivative = 1.78 \[ \int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {16 \, b^{2} \cos \left (d x + c\right )^{7} - 240 \, a b d x \cos \left (d x + c\right )^{4} + 480 \, a b d x \cos \left (d x + c\right )^{2} - 16 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{5} - 240 \, a b d x + 50 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{3} - 30 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right ) + 15 \, {\left ({\left (3 \, a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 3 \, a^{2} - 4 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 15 \, {\left ({\left (3 \, a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 3 \, a^{2} - 4 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 16 \, {\left (3 \, a b \cos \left (d x + c\right )^{5} - 20 \, a b \cos \left (d x + c\right )^{3} + 15 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^5*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/48*(16*b^2*cos(d*x + c)^7 - 240*a*b*d*x*cos(d*x + c)^4 + 480*a*b*d*x*cos(d*x + c)^2 - 16*(3*a^2 - 4*b^2)*co
s(d*x + c)^5 - 240*a*b*d*x + 50*(3*a^2 - 4*b^2)*cos(d*x + c)^3 - 30*(3*a^2 - 4*b^2)*cos(d*x + c) + 15*((3*a^2
- 4*b^2)*cos(d*x + c)^4 - 2*(3*a^2 - 4*b^2)*cos(d*x + c)^2 + 3*a^2 - 4*b^2)*log(1/2*cos(d*x + c) + 1/2) - 15*(
(3*a^2 - 4*b^2)*cos(d*x + c)^4 - 2*(3*a^2 - 4*b^2)*cos(d*x + c)^2 + 3*a^2 - 4*b^2)*log(-1/2*cos(d*x + c) + 1/2
) - 16*(3*a*b*cos(d*x + c)^5 - 20*a*b*cos(d*x + c)^3 + 15*a*b*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^4 -
2*d*cos(d*x + c)^2 + d)

Sympy [F(-1)]

Timed out. \[ \int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**6*csc(d*x+c)**5*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.18 \[ \int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {16 \, {\left (15 \, d x + 15 \, c + \frac {15 \, \tan \left (d x + c\right )^{4} + 10 \, \tan \left (d x + c\right )^{2} - 2}{\tan \left (d x + c\right )^{5} + \tan \left (d x + c\right )^{3}}\right )} a b - 4 \, {\left (4 \, \cos \left (d x + c\right )^{3} - \frac {6 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + 24 \, \cos \left (d x + c\right ) - 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} b^{2} - 3 \, a^{2} {\left (\frac {2 \, {\left (9 \, \cos \left (d x + c\right )^{3} - 7 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} - 16 \, \cos \left (d x + c\right ) + 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^5*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/48*(16*(15*d*x + 15*c + (15*tan(d*x + c)^4 + 10*tan(d*x + c)^2 - 2)/(tan(d*x + c)^5 + tan(d*x + c)^3))*a*b -
 4*(4*cos(d*x + c)^3 - 6*cos(d*x + c)/(cos(d*x + c)^2 - 1) + 24*cos(d*x + c) - 15*log(cos(d*x + c) + 1) + 15*l
og(cos(d*x + c) - 1))*b^2 - 3*a^2*(2*(9*cos(d*x + c)^3 - 7*cos(d*x + c))/(cos(d*x + c)^4 - 2*cos(d*x + c)^2 +
1) - 16*cos(d*x + c) + 15*log(cos(d*x + c) + 1) - 15*log(cos(d*x + c) - 1)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 346 vs. \(2 (164) = 328\).

Time = 0.40 (sec) , antiderivative size = 346, normalized size of antiderivative = 1.99 \[ \int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 16 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 48 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 960 \, {\left (d x + c\right )} a b - 432 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {128 \, {\left (3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 9 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2} + 7 \, b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}} - \frac {750 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1000 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 432 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 48 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 16 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^5*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/192*(3*a^2*tan(1/2*d*x + 1/2*c)^4 + 16*a*b*tan(1/2*d*x + 1/2*c)^3 - 48*a^2*tan(1/2*d*x + 1/2*c)^2 + 24*b^2*t
an(1/2*d*x + 1/2*c)^2 + 960*(d*x + c)*a*b - 432*a*b*tan(1/2*d*x + 1/2*c) + 120*(3*a^2 - 4*b^2)*log(abs(tan(1/2
*d*x + 1/2*c))) - 128*(3*a*b*tan(1/2*d*x + 1/2*c)^5 - 3*a^2*tan(1/2*d*x + 1/2*c)^4 + 9*b^2*tan(1/2*d*x + 1/2*c
)^4 - 6*a^2*tan(1/2*d*x + 1/2*c)^2 + 12*b^2*tan(1/2*d*x + 1/2*c)^2 - 3*a*b*tan(1/2*d*x + 1/2*c) - 3*a^2 + 7*b^
2)/(tan(1/2*d*x + 1/2*c)^2 + 1)^3 - (750*a^2*tan(1/2*d*x + 1/2*c)^4 - 1000*b^2*tan(1/2*d*x + 1/2*c)^4 - 432*a*
b*tan(1/2*d*x + 1/2*c)^3 - 48*a^2*tan(1/2*d*x + 1/2*c)^2 + 24*b^2*tan(1/2*d*x + 1/2*c)^2 + 16*a*b*tan(1/2*d*x
+ 1/2*c) + 3*a^2)/tan(1/2*d*x + 1/2*c)^4)/d

Mupad [B] (verification not implemented)

Time = 11.63 (sec) , antiderivative size = 479, normalized size of antiderivative = 2.75 \[ \int \cos (c+d x) \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {15\,a^2}{8}-\frac {5\,b^2}{2}\right )}{d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {13\,a^2}{4}-2\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (36\,a^2-98\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {173\,a^2}{4}-\frac {242\,b^2}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {303\,a^2}{4}-134\,b^2\right )-\frac {a^2}{4}+32\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+136\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {320\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{3}+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9-\frac {4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}}{d\,\left (16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+48\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+48\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2}{4}-\frac {b^2}{8}\right )}{d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12\,d}-\frac {10\,a\,b\,\mathrm {atan}\left (\frac {100\,a^2\,b^2}{-\frac {75\,a^3\,b}{2}+100\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^2+50\,a\,b^3}-\frac {50\,a\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{-\frac {75\,a^3\,b}{2}+100\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^2+50\,a\,b^3}+\frac {75\,a^3\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,\left (-\frac {75\,a^3\,b}{2}+100\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^2+50\,a\,b^3\right )}\right )}{d}-\frac {9\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,d} \]

[In]

int((cos(c + d*x)^6*(a + b*sin(c + d*x))^2)/sin(c + d*x)^5,x)

[Out]

(log(tan(c/2 + (d*x)/2))*((15*a^2)/8 - (5*b^2)/2))/d + (a^2*tan(c/2 + (d*x)/2)^4)/(64*d) + (tan(c/2 + (d*x)/2)
^2*((13*a^2)/4 - 2*b^2) + tan(c/2 + (d*x)/2)^8*(36*a^2 - 98*b^2) + tan(c/2 + (d*x)/2)^4*((173*a^2)/4 - (242*b^
2)/3) + tan(c/2 + (d*x)/2)^6*((303*a^2)/4 - 134*b^2) - a^2/4 + 32*a*b*tan(c/2 + (d*x)/2)^3 + 136*a*b*tan(c/2 +
 (d*x)/2)^5 + (320*a*b*tan(c/2 + (d*x)/2)^7)/3 + 4*a*b*tan(c/2 + (d*x)/2)^9 - (4*a*b*tan(c/2 + (d*x)/2))/3)/(d
*(16*tan(c/2 + (d*x)/2)^4 + 48*tan(c/2 + (d*x)/2)^6 + 48*tan(c/2 + (d*x)/2)^8 + 16*tan(c/2 + (d*x)/2)^10)) - (
tan(c/2 + (d*x)/2)^2*(a^2/4 - b^2/8))/d + (a*b*tan(c/2 + (d*x)/2)^3)/(12*d) - (10*a*b*atan((100*a^2*b^2)/(50*a
*b^3 - (75*a^3*b)/2 + 100*a^2*b^2*tan(c/2 + (d*x)/2)) - (50*a*b^3*tan(c/2 + (d*x)/2))/(50*a*b^3 - (75*a^3*b)/2
 + 100*a^2*b^2*tan(c/2 + (d*x)/2)) + (75*a^3*b*tan(c/2 + (d*x)/2))/(2*(50*a*b^3 - (75*a^3*b)/2 + 100*a^2*b^2*t
an(c/2 + (d*x)/2)))))/d - (9*a*b*tan(c/2 + (d*x)/2))/(4*d)